/*renderCustomers = strand(function() {						*/renderCustomers=function(){var examples,_cp=1;var _f=_frm(arguments);return _f.clsr(function(){_s:while(1){switch(_cp){case 1:_cp=2;case 2:if((_f.v2=
/*	var examples = yield (yield pjs.load("root")).examples;						*/pjs.load("root"))===_S){break _s;}_cp=3;case 3:if((_f.v3=_g((_f.v2),"examples"))===_S){break _s;}examples=_f.v3;
/*	if (!examples.customers) {						*/if(!examples.customers){_p(
/*		examples.customers = [];						*/examples,"customers",[]);
/*		pjs.save(examples);						*/pjs.save(examples);}
/*	}						*/
/*	customers = examples.customers; // get the customers object, the list of the customers						*/customers=examples.customers;_p(
/*	document.getElementById('customerFields').style.display='none';//make sure the customers field is hidden						*/document.getElementById("customerFields").style,"display","none");
/*	customersElement = document.getElementById("customersDiv");						*/customersElement=document.getElementById("customersDiv");_p(
/*	customersElement.innerHTML = ""; // clear it out						*/customersElement,"innerHTML","");
/*	Array.forEach(customers,function(customer) { // iterate through the customers						*/Array.forEach(customers,function(customer){
/*		var customerElement = customersElement.appendChild(document.createElement('div'))						*/var customerElement=customersElement.appendChild(document.createElement("div"))
/*																	.appendChild(document.createElement('a'));						*/.appendChild(document.createElement("a"));_p(
/*		customerElement.href="#";						*/customerElement,"href","#");_p(
/*		customerElement.innerHTML = customer.firstName + " " + customer.lastName;// render each customer in a new div						*/customerElement,"innerHTML",customer.firstName+" "+customer.lastName);
/*		(function(customer){customerElement.onclick =function() {						*/(function(customer){_p(customerElement,"onclick",function(){
/*			renderCustomer(customer);						*/renderCustomer(customer);});})(
/*		}})(customer);//bind the customer to this function						*/customer);});return;}}return _f.sus(this)}).call(this)};
/*	});						*/
/*})						*/
/*function renderCustomer(customer) {						*/function renderCustomer(customer){_p(
/*	customersElement.innerHTML = "<h2>" + customer.firstName + " " + customer.lastName+ "</h2>" + 						*/customersElement,"innerHTML","<h2>"+customer.firstName+" "+customer.lastName+"</h2>"+
/*		"<h4>created " + customer.created + "</h4>";							*/"<h4>created "+customer.created+"</h4>");
/*	var customerFieldsDiv = document.getElementById('customerFields');						*/var customerFieldsDiv=document.getElementById("customerFields");_p(
/*	customerFieldsDiv.style.display='block';						*/customerFieldsDiv.style,"display","block");
/*	customerFieldInputs = customerFieldsDiv.getElementsByTagName("input"); 						*/customerFieldInputs=customerFieldsDiv.getElementsByTagName("input");
/*	for (var i = 0; i < customerFieldInputs.length; i++) // automatically populate values by matching the input names with object properties						*/for(var i=0;i<customerFieldInputs.length;i++)_p(
/*		customerFieldInputs[i].value = customer[customerFieldInputs[i].name];						*/customerFieldInputs[i],"value",customer[customerFieldInputs[i].name]);_p(
/*							*/
/*	document.getElementById('customerOk').onclick = function() {						*/document.getElementById("customerOk"),"onclick",function(){
/*		pjs.changing(customer); // this an optional call to make before modification 						*/pjs.changing(customer);
/*									// so that only modifications are sent back to the server instead of the whole object						*/
/*									 						*/
/*		for (var i = 0; i < customerFieldInputs.length; i++) // just reverse the process!						*/for(var i=0;i<customerFieldInputs.length;i++)_p(
/*			customer[customerFieldInputs[i].name] = customerFieldInputs[i].value;						*/customer,customerFieldInputs[i].name,customerFieldInputs[i].value);
/*		// If we set persevere.setAutoSet(true) before loading these scripts, we would not need to explicitly call save						*/
/*		pjs.save(customer); // must explicitly save the object							*/pjs.save(customer);
/*		renderCustomers(); 						*/renderCustomers();});_p(
/*	}						*/
/*							*/
/*	document.getElementById('customerDelete').onclick = function() {						*/document.getElementById("customerDelete"),"onclick",function(){
/*		Array.remove(customers,customer);						*/Array.remove(customers,customer);
/*		renderCustomers();						*/renderCustomers();});}
/*	}						*/
/*}						*/
/*function addCustomer() {						*/function addCustomer(){
/*	var newCustomer = {						*/var newCustomer={
/*		firstName : "first name",						*/firstName:"first name",
/*		lastName : "last name",						*/lastName:"last name",
/*		created : new Date(),						*/created:new Date,
/*		address : "",						*/address:"",
/*		phoneNumber : "",						*/phoneNumber:"",
/*		comment : ""						*/comment:""};
/*	};						*/
/*	customers.push(newCustomer); // add a new customer to the top of the array using standard array functions						*/customers.push(newCustomer);
/* 	renderCustomer(newCustomer);						*/renderCustomer(newCustomer);}
/*}						*/
/*renderCustomers();						*/renderCustomers();

